package com.tengju.settlement.domain.model.depository;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum BindStatus {

    INIT(1, "初始化"),
    SUCCESS(2, "成功"),
    AUTHENTICATING(3, "鉴权中"),
    FAIL(4, "失败"),
    LOGICAL_UNBIND(5, "逻辑解绑"),
    ;

    Integer val;
    String desc;

    public static BindStatus fromVal(Integer val) {
        if (val == null) {
            return null;
        }

        for (BindStatus status : values()) {
            if (status.val.equals(val)) {
                return status;
            }
        }
        return null;
    }

}
